<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>我的考卷</title>
<script type="text/javascript" src="static/easyui/jquery.min.js"></script>
<script type="text/javascript" src="static/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="static/easyui/locale/easyui-lang-zh_CN.js"></script>
<link rel="stylesheet" href="static/easyui/themes/icon.css">
<link rel="stylesheet" href="static/easyui/themes/metro-red/easyui.css">
</head>
<body>
<style type="text/css">
.test-one{
		width:1100px;
		height:30px;
		margin:10px auto;
		display: block;
		font-size:13px;
}
.test-serach{
		width:300px;
		height:30px;
		float:left;
		margin-left: 26px;
}
#mytests{
		width: 100%;
		margin:auto;
	    overflow-x: auto;
	    margin-top: 5px;
	    border-collapse: collapse;
	    border: 1px solid #e4e7ec;
	    background-color: #fff;
   		color: gray;
   		font-size:12px; 
	}
	#mytests thead{
		color: #19AA8D;
	    font-size: 14px;
	    font-weight: 700;
	} 
	#mytests th{
		background: #6666661a;
	}
	#mytests td{
		border: 1px solid #e4e7ec;
		width: 150px;
		height: 50px;
	}
.datagrid-header-row td{
		background: #E6E6E6;
		color: #19AA9C;
	    font-size: 14px;
	    font-weight: 700;
	    text-align: center;
	}
	.datagrid-row td{
		background: #fff;
		font-size: 12px;
		text-align: center;
	}	
.mytestchakan{
		background-color:#1AB394;
		color:white;
		border:none;
		width:50px;
		height:20px;
		cursor: pointer;
}
 #mytestlooks{
	width:620px;
	height:200px;
	border:solid 1px #DADADA;
	margin:auto;
}
.insertcontents{
	width:600px;
	height:150px;
	margin-top:10px;
}
.insert-lefts{
	width:210px;
	height:150px;
	float:left;
	margin-left:40px;
}
.insert-rights{
	width:240px;
	height:150px;
	float:right;
	margin-right: 20px;
}
#mytestid,#mytestmark,#myteststa{
	margin-top: 10px;
}
#myteststart,#mytestend{
	width:173px;
	height:21px;
}
.bioanniu{
	margin-right:10px;
	width:100px;
	height:30px;
	float:right;
}
#mytestclose{
	width:60px;
	background-color:#17AA8D;
	cursor: pointer;
	color:white;
}
.mytestlooks{
		color:white;
		cursor: pointer;
		border:none;
}
	.icon-mytest-chakan{
		padding-left: 20px;
		background:url('static/easyui/themes/icons/chakan.png') no-repeat 5% 50%;
		background-color:#1AB394;
}
#myteststart,#mytestend{
		width:170px;
}
	.textbox-invalid,.validatebox-invalid{
		border:1px solid #CCCCCC;
		background-color: #fff;
		border-radius:4px;		
		height:20px;
		font-size:14px;
	}
.textbox {
	width:170px;
	height:20px;
	margin-top:10px;
    position: relative;
    border: 1px solid #ddd;
    background-color: #fff;
    vertical-align: middle;
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
}
.icon-mytest-bianji{
	padding-left: 20px;
		background:url('static/easyui/themes/icons/bianji.png') no-repeat 5% 50%;
		background-color:#1AB394;
}
</style>
<script type="text/javascript">
function searchmytest(value,name){
	$("#mytests").datagrid({
	    url:'select-mytest',
	    queryParams:{
	    	ttestname:value
	    },
	    columns:[[
	    	{field:'aa',checkbox:true,title:'选择',width:100},
	    	{field:'texamid',hidden:true,title:'编号',width:150},
	    	{field:'ttestid',hidden:true,title:'编号',width:150},
	    	{field:'mytest',title:'序号',width:60},
	    	{field:'ttestname',title:'试卷名称',width:200},
	    	{field:'texamtime',title:'时长',width:80},
			{field:'texamledge',title:'知识组',width:220},
			{field:'texamstart',title:'开始时间',width:180,
				formatter:function(val,rec){
				return formattime(val);
	        	}
			},
			{field:'texamend',title:'结束时间',width:180,
				formatter:function(val,rec){
				return formattime(val);
	        	}
			},
	    	{field:'caozuo',title:'操作',width:150,align:'center',
				formatter: function(value,row,index){
					return "<input type='button' onclick='mytesttake("+row['ttestid']+")' class='mytestchakan icon-mytest-bianji' style='width:60px;height: 20px;margin-left:20px;font-size:12px;border-radius:4px;color:#fff;background-color:#1AB394;cursor: pointer;' value='考试'/>";
				},
			}
	    	]],	
	         	pagination:true,
			    pageNumber:1,
			    pageSize:5,
			    pageList:[5,10,15]  
	});
}
$(function(){
	searchmytest(null);
});
	//搜索
	function checkmytest(value,name){   
		searchmytest(value,name);
		}  
		 //点击考试到答题界面
		 function mytesttake(id){
			 $("#content-admin").panel({
					href:"taketest?id="+id
				})
		 }
			 //时间转换
			function formattime(value,row,index){
				var date = new Date(value);
				        var year = date.getFullYear().toString();
				        var month = (date.getMonth() + 1);
				        var day = date.getDate().toString();
				        var hour = date.getHours().toString();
				        var minutes = date.getMinutes().toString();
				        var seconds = date.getSeconds().toString();
				        if (month < 10) {
				            month = "0" + month;
				        }
				        if (day < 10) {
				            day = "0" + day;
				        }
				        if (hour < 10) {
				            hour = "0" + hour;
				        }
				        if (minutes < 10) {
				            minutes = "0" + minutes;
				        }
				        if (seconds < 10) {
				            seconds = "0" + seconds;
				        }
				        return year + "-" + month + "-" + day + " " + hour + ":" + minutes + ":" + seconds;
			}
</script>
	<div class="mytest">
		<div class="test-one">
			<div class="test-serach">
			<input class="easyui-searchbox" searcher="checkmytest" style="width:240px" data-options="prompt:'名称'"></input>
			</div>
		</div>
		<div class="test-two" style="width:1100px;margin:10px auto;height:500px;">
			<table id="mytests" class="easyui-datagrid" style="width:1100px;height:300px;margin:auto;">
			</table>
		</div>
 </div>
</body>
</html>